From: Juri Linkov Date: Wed, 12 Aug 2009 20:55:31 +0000 (+0000) Subject: (read-regexp): Return empty string when `default-value' is nil. X-Git-Tag: archive/raspbian/1%29.2+1-2+rpi1~1^2~324^2~11133 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:///%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:/?a=commitdiff_plain;h=1459294d27076ba8fde6a14fc9f0353342216fd0;p=emacs.git (read-regexp): Return empty string when `default-value' is nil. (keep-lines-read-args): Don't use empty string as the default value for `read-regexp'. (Bug#2495) --- diff --git a/lisp/replace.el b/lisp/replace.el index a375c87e74f..c69b4cd3c2b 100644 --- a/lisp/replace.el +++ b/lisp/replace.el @@ -556,7 +556,7 @@ regexp, the last isearch string, and the last replacement regexp." (format "%s: " prompt)) nil nil nil 'regexp-history defaults t))) (if (equal input "") - default-value + (or default-value input) (prog1 input (add-to-history 'regexp-history input))))) @@ -570,7 +570,7 @@ regexp, the last isearch string, and the last replacement regexp." "Read arguments for `keep-lines' and friends. Prompt for a regexp with PROMPT. Value is a list, (REGEXP)." - (list (read-regexp prompt "") nil nil t)) + (list (read-regexp prompt) nil nil t)) (defun keep-lines (regexp &optional rstart rend interactive) "Delete all lines except those containing matches for REGEXP.